package com.ruoyi.api.utils;


import com.ruoyi.vim.domain.ImGroup;
import com.ruoyi.vim.domain.TransImGroup;


public class SysGroup {

    public ImGroup trans(TransImGroup transImGroup){
        ImGroup imGroup = new ImGroup();
        imGroup.setId(String.valueOf(transImGroup.getId()));
        imGroup.setName(transImGroup.getName());
        imGroup.setAvatar(transImGroup.getAvatar());
        imGroup.setMaster(transImGroup.getMaster());
        imGroup.setAnnouncement(transImGroup.getAnnouncement());
        imGroup.setNeedCheck(transImGroup.getNeedCheck());
        imGroup.setCreateTime(transImGroup.getCreateTime());
        imGroup.setUpdateTime(transImGroup.getUpdateTime());
        imGroup.setCreateBy((transImGroup.getCreateBy() == null)? "null" : String.valueOf(transImGroup.getCreateBy()));
        imGroup.setUpdateBy((transImGroup.getUpdateBy() == null)? "null" : String.valueOf(transImGroup.getUpdateBy()));        imGroup.setDelFlag(transImGroup.getDelFlag());
        imGroup.setRemark(transImGroup.getRemark());
        return imGroup;
    }

    public TransImGroup tran(ImGroup imGroup){
        TransImGroup transImGroup = new TransImGroup();
        transImGroup.setName(imGroup.getName());
        transImGroup.setAvatar(imGroup.getAvatar());
        transImGroup.setMaster(imGroup.getMaster());
        transImGroup.setAnnouncement(imGroup.getAnnouncement());
        transImGroup.setNeedCheck(imGroup.getNeedCheck());
        transImGroup.setCreateTime(imGroup.getCreateTime());
        transImGroup.setUpdateTime(imGroup.getUpdateTime());
        transImGroup.setCreateBy(Long.valueOf(imGroup.getCreateBy()));
        transImGroup.setUpdateBy(Long.valueOf(imGroup.getUpdateBy()));
        transImGroup.setDelFlag(imGroup.getDelFlag());
        transImGroup.setRemark(imGroup.getRemark());
        return transImGroup;
    }

}
